package com.caishi.lkx.distribution.api;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.caishi.lkx.distribution.mapper.DistributionWithdrawalsMapper;
import com.caishi.lkx.distribution.model.DistributionWithdrawals;
import com.caishi.lkx.distribution.service.IDistributionWithdrawalsService;
import com.zzw.common.annotation.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/distribute/withdrawals")
public class WithdrawalsController {
    private final IDistributionWithdrawalsService distributionWithdrawalsService;

    public WithdrawalsController(IDistributionWithdrawalsService distributionWithdrawalsService) {
        this.distributionWithdrawalsService = distributionWithdrawalsService;
    }

    @ApiResult
    @GetMapping("/list")
    public Page<DistributionWithdrawals> list(@RequestParam Map<String, Object> params){
        Integer current= Integer.parseInt(params.get("current").toString());
        Integer size= Integer.parseInt(params.get("size").toString());
        return distributionWithdrawalsService.getList(new Page<DistributionWithdrawals>(current, size), params);
    }
}
